package org.lanqiao.controller;

import javax.annotation.Resource;

import org.lanqiao.orm.DbUser;
import org.lanqiao.service.ISelectInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class UserLoginControl {
	@Resource
	private ISelectInfoService selectService;
	
	@RequestMapping(value="/login",method=RequestMethod.POST)
	public String login(String userNum,Model model){
		System.out.println("登陆处理"+userNum);
		Integer usernum=Integer.valueOf(userNum);
		System.out.println(userNum==null?"null":"not null");
		DbUser user=selectService.selectUserInfo(usernum);
		String strUserName=user.getUsername();
		model.addAttribute("loggerName", strUserName);
		System.out.println(user);
		return "logined";
	}

}
